Contemporary systems on chip (SoC) usually include multiple processing units or cores, and multiple peripherals. Peripherals may include, for instance, Direct Memory Access (DMA) engines or Digital Signal Processing (DSP) accelerators.
Applications running on such systems may be broken into multiple tasks which can be executed in parallel on the cores. In particular, packet management systems, also known as networking systems, comprise multiple processing cores which are capable of processing packets concurrently.
In the context of networking systems which includes data stream (in the form of data packets) flowing in via a given input port, a processing unit may be in charge of analyzing the packets for the purpose of managing the communication of packets throughout the system.
This may comprise an analysis of the header of the packets coming into the system for determining what has to be done with the packets (routing into another port; drop; passing over to a networking stack in this or another SoC, etc.). This can be achieved either directly based on the data or a portion of the data that is flowing in, or indirectly on the basis of some data which is the outcome of mathematical operation on the above data (such as key information which can be derived from the header of the packet).
A known solution for determining what needs to be done with a packet comprises performing a table lookup (TLU) which allows determining the next action to be applied to the packet, based on information associated with the table entry that is found. A lookup table is a memory array whose contents may be retrieved by simple array indexing operations.
A packet may “flow” through several such tables until the entire path of the packet is determined. Therefore packets flowing through the networking system may be numerous and in various phases of their processing at any given time.
The content of any lookup table may be pre-calculated and stored in memory, or may be pre-fetched as part of a program's initialization phase, for instance. But the table contents may change while the system is being operated. That means that, in parallel to the operation of the system, a need may arise to change the content of the tables. The case may be, also, that a table content which is subject to any single change influences several lookup tables.
Thus the lookup tables used for the purpose of flow control in a networking system may be updated by changing entries in the tables. Changes may occur in more than a single table within the system. While updating two or more lookup tables, each by an atomic update mechanism, packets that passed a first updated table and which did not pass a second updated table may be caught in an undefined state, where past flow control is done by rules of the non-updated system while future flow control is to be made by rules of updated system. Such combination is not valid and may cause undesirable behaviour.
In order to manage a transition from non-updated system to updated system two methods are known, namely System Draining and System Shadowing.
According to a system Draining technique, the programmer stops the introduction of new packets into the non-updated system upon the launch of the lookup tables update process. The non-updated system continues to operate until the residual flow of packets is cleared. Once this flow finishes, the system is updated. The input of packets in the system is resumed once change is completed. This method creates a cease of packet flow coming in the system for the purpose of lookup tables update. However, overall system performance is reduced, since some packets may need to be dropped and, upon frequent dynamic change, the impact may be severe.
According to the System Shadowing technique, the programmer creates a shadow of the non-updated system. Any new packet flows through the updated system while the residual packets of the flow of packets already in the system follow their path through the shadow of the non-updated system until the end. Upon termination of background processing of these residual packets the updated system becomes the new foreground system in use. This method is expensive in terms of memory consumption, especially for systems with large tables.
System Shadowing is illustrated by U.S. Pat. No. 8,516,021 which discloses a method of updating a file system in a Distributed Shared Memory (DSM), using a shadow data segment whose contents are identical to an original data segment currently being updated. All contents are updated in a data segment and all changes are applied concurrently. Users are blocked from accessing the data segments until the writing operation has been completed.